const { BaseCommand } = require("./base");
const fs = require("node:fs");
const { get_fst_file, get_full_path } = require("../utils/file_tool");
class StreamCommand extends BaseCommand {
    async execute() {
        if (this.selfData.type === "write") {
            return fs.createWriteStream(get_full_path(this.selfData.dst));
        } else {
            return fs.createReadStream(get_fst_file(this.selfData.src));
        }
    }
}

module.exports = {
    StreamCommand,
};
